package edu.ssdut.revise.models;

import com.github.javaparser.ast.Node;
import com.github.javaparser.ast.body.EnumDeclaration;

import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

public class VisEnumNode extends VisBaseNode {
    private final String identifier;
    private final List<String> modifiers;
    private final List<String> annotations;
    private final List<String> entries;

    public VisEnumNode(EnumDeclaration ed) {
        super(ed);
        this.identifier = ed.getNameAsString();
        this.modifiers = ed.getModifiers().stream().map(Node::toString).collect(Collectors.toList());
        this.annotations = ed.getAnnotations().stream().map(Objects::toString).collect(Collectors.toList());
        this.entries = ed.getEntries().stream().map(Objects::toString).collect(Collectors.toList());
    }

    @Override
    public String getTypeName() {
        return "EnumNode";
    }

    public String getIdentifier() {
        return identifier;
    }

    public List<String> getModifiers() {
        return modifiers;
    }

    public List<String> getAnnotations() {
        return annotations;
    }

    public List<String> getEntries() {
        return entries;
    }
}
